// 管理 SKU 模块接口的 ts 数据类型
export interface ResponseData {
  code: number
  message: string
  ok: boolean
}

// 定义sku对象的ts类型
export interface attr {
  attrId: number | string //平台属性的ID
  valueId: number | string //属性值的ID
}
// 销售属性
export interface saleAttr {
  id?: number
  saleAttrId: number | string //属性ID
  saleAttrValueId: number | string //属性值的ID
}
// 新增 sku 需要携带参数的类型
export interface SkuData {
  category3Id: number | string
  spuId: number | string
  tmId: number | string
  skuName: string
  price: number | string
  weight: number | string
  skuDesc: string
  skuAttrValueList: attr[]
  skuSaleAttrValueList: saleAttr[]
  skuDefaultImg: string
  isSale?: number
  id?: number
}

// 定义sku接口返回的数据类型
export interface skuResponseData extends ResponseData {
  data: {
    records: SkuData[]
    total: number
    size: number
    current: number
    orders: []
    optimizeCountSql: boolean
    hitCount: boolean
    countId: null
    maxLimit: null
    searchCount: boolean
    pages: number
  }
}

// sku 商品详情数据类型
export interface skuInfoData extends ResponseData {
  data: SkuData
}
